package com.nb.hdj.util;

import org.openqa.selenium.WebDriver;

/**
 * @Description: 分布式自动化测试工具类
 * @Author: hedongjia
 * @Date: 2021/12/1 上午10:28
 * @Version: v1.0
 */
public class BrowserUtils {
    private static ThreadLocal<WebDriver> threadLocal=new ThreadLocal<>();
    /**
     * 从线程ThreadLocal获取存放的驱动
     * @return
     */

    public static WebDriver getDriver(){
        return threadLocal.get();
    }
    /**
     * 将驱动设置给线程ThreadLocal
     * @param driver
     */
    public static void setDriver(WebDriver driver){
        threadLocal.set(driver);
    }

}
